﻿shogunate_map_color_save_all_effect = {

	title:e_nmih_japan = {
		every_in_de_jure_hierarchy = {
			save_scope_as = original_title
			shogunate_map_color_save_effect = { TITLE = scope:original_title }
		}
	}

	shogunate_map_color_save_effect = { TITLE = title:e_nmih_japan }
	shogunate_map_color_save_effect = { TITLE = title:e_nmih_tenno }
	shogunate_map_color_save_effect = { TITLE = title:e_nmih_joko }
	shogunate_map_color_save_effect = { TITLE = title:e_nmih_nancho }
	shogunate_map_color_save_effect = { TITLE = title:e_nmih_unifier }
	shogunate_map_color_save_effect = { TITLE = title:e_nmih_third_force }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_kanrei }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_ushu_tandai }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_oshu_tandai }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_kamakura_kubo }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_kanto_kanrei }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_kyushu_tandai }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_mutsu_shogun }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_seito_shogun }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_seisei_shogun }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_oshu_kanrei }

	shogunate_map_color_save_effect = { TITLE = title:k_nmih_honganji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_eastern_honganji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_western_honganji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_enryakuji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_kofukuji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_kumano }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_nikko }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_kuonji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_hokekyoji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_honmonji }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_hakata }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_sakai }

	shogunate_map_color_save_effect = { TITLE = title:k_nmih_yamashiro }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_shinano }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_echizen }
	shogunate_map_color_save_effect = { TITLE = title:k_nmih_kawachi }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_aizu }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_southern_omi }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_northern_omi }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_southern_higo }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_northern_higo }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_western_mikawa }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_eastern_mikawa }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_tsugaru }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_northern_ise }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_central_iyo }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_southern_iyo }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_oyama }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_utsunomiya }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_ashikaga }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_date }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_tsukuba }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_nitta }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_uesugi }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_hojo }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_amago_revival_army }

	shogunate_map_color_save_effect = { TITLE = title:d_nmih_wajinchi }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_matsumae }
	shogunate_map_color_save_effect = { TITLE = title:d_nmih_shimokuni }

}

shogunate_map_color_save_effect = {

	if = {
		limit = {
			$TITLE$ ?= { is_title_created = yes }
		}
		create_dynamic_title = {
			tier = duchy
			name = d_placeholder
		}
		scope:new_title = {
			set_color_from_title = $TITLE$
			set_capital_county = title:c_nmih_otagi
			set_coa = $TITLE$
			set_definitive_form = yes
			set_landless_title = yes
		}
		$TITLE$ = {
			set_variable = {
				name = shogunate_map_color_title
				value = scope:new_title
			}
		}
	}

}

shogunate_map_color_load_effect = {

	if = {
		limit = {
			exists = var:shogunate_map_color_title
		}
		set_color_from_title = var:shogunate_map_color_title
	}

}

shogunate_map_color_copy_effect = {

	if = {
		limit = {
			exists = $FROM$.var:shogunate_map_color_title
		}
		set_color_from_title = $FROM$.var:shogunate_map_color_title
	}

}
